package com.github.shiqiyue.learn.guava;

import com.google.common.base.Joiner;
import org.apache.logging.log4j.util.Strings;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Arrays;

/***
 * Joiner测试
 * @author wenyao.wu
 * @date 2018/7/2
 */
public class JoinerTest {

    private static final Logger logger = LoggerFactory.getLogger(JoinerTest.class);

    public static void main(String[] args) {
        /***
         * list连接成String
         */
        logger.info(Joiner.on("-")
                .useForNull("null")
                .join(Arrays.asList(1, 2, 3, 4, 5, null, 6)));
    }
}
